import request from '@/config/axios'

// 车辆维修记录 VO
export interface VehicleRepairVO {
  vehicleName: string // 车辆名称
  licensePlate: string // 车辆号码
  repairDate: Date // 维修日期
  repairCost: number // 维修费用(元)
  repairContent: string // 维修内容
  repairLocation: string // 维修地点
  handlerId: string // 经手人
}

// 车辆维修记录 API
export const VehicleRepairApi = {
  // 查询车辆维修记录分页
  getVehicleRepairPage: async (params: any) => {
    return await request.get({ url: `/oa/vehicle-repair/page`, params })
  },

  // 查询车辆维修记录详情
  getVehicleRepair: async (id: number) => {
    return await request.get({ url: `/oa/vehicle-repair/get?id=` + id })
  },

  // 新增车辆维修记录
  createVehicleRepair: async (data: VehicleRepairVO) => {
    return await request.post({ url: `/oa/vehicle-repair/create`, data })
  },

  // 修改车辆维修记录
  updateVehicleRepair: async (data: VehicleRepairVO) => {
    return await request.put({ url: `/oa/vehicle-repair/update`, data })
  },

  // 删除车辆维修记录
  deleteVehicleRepair: async (id: number) => {
    return await request.delete({ url: `/oa/vehicle-repair/delete?id=` + id })
  },

  // 导出车辆维修记录 Excel
  exportVehicleRepair: async (params) => {
    return await request.download({ url: `/oa/vehicle-repair/export-excel`, params })
  }
}